<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html style="overflow: auto; overflow-y:hidden">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>Insert title here</title>
		<link href="css/background.css" rel="stylesheet" type="text/css" />
		<link href="css/table.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="js/openwindow.js"></script>
		<script type="text/javascript">
function addOrg(){
	var url="addInit.action?orgId=${orgId}";
	openWindow(url,650,200);
}

function getParent(){
	window.parent.loadOrg();
}

function getById(id){
	var url="getOrgObjById.action?orgId="+id;
	openWindow(url,650,200);
}
function deleteOrg(id){
	if(confirm("确定要删除组织？")){
		var param={"orgId":id};
		$.post("deleteOrg.action",param,function(data){
			if(data=='success'){
				alert("删除组织成功！");
				window.location.reload();
				 window.parent.loadTree();
			}else{
				alert("删除组织失败！");
			}
		});
	}
}

function page(currentPage){
	window.location.href="getOrgListById.action?currentPage="+currentPage+"&orgId=${orgId}"
}
</script>
	</head>
	<body>
	<table  align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
  <tbody>
  <tr>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
    <td style="background: url('image/wsoa_window_002.gif');"><table border="0" cellpadding="0" cellspacing="0">
      <tbody><tr>
        <td align="center" style="background: url('image/wsoa_window_002.gif');" width="10"><img src="image/center_19.gif"></td>
        <td align="center" style="background: url('image/wsoa_window_002.gif');"></td>
        <td>系统管理 &gt; 基础设置 &gt;组织管理</td>
        </tr>
    </tbody>
    </table></td>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
  </tr>
  <tr>
    <td style="background: url('image/wsoa_window_010.gif');"  width="1">&nbsp;</td>
    <td>
		
		<table align="right" class="intable">
			<tr>
				<td>
				<input type="button" class="button_02" value="添加"
						onclick="addOrg();" style="line-height: 20px; float: right" />
				</td>
				<td>
				<input type="button" class="button_02" value="返回"
						onclick="window.location.href='getOrgListById.action?orgId=${organization==null?0:organization.pid}'" style="line-height: 20px; float: right" /></td>
			</tr>
		</table>
		
		<table class="righ_list" frame="box" cellspacing="1" cellpadding="0" style="width: 100%"  border="0">
			<tr class="reigh_list2">
				<th width="100px">
					部门编号
				</th>
				<th  width="300px">
					部门名称
				</th>
				<th  width="300px">
					上级部门
				</th>
				<th width="100px">
					排序
				</th>
				<th width="150px">
					操作
				</th>
			</tr>
			<c:if test="${empty orgList}">
				<tr class="reigh_list4">
					<td colspan="5">
						没有相关的记录！
					</td>
				</tr>
			</c:if>
			<c:forEach items="${orgList}" var="org">
				<tr class="reigh_list4">
					<td width="100px"  align="center">
						${org.id}
					</td>
					<td  width="300px" align="center">
						<a href="getOrgListById.action?orgId=${org.id}">${org.name}</a>
					</td>
					<td  width="300px">
						${organization.name}
					</td>
					<td  width="100px">
						${org.px}
					</td>
					<td align="center" width="150px">
						<img alt="修改" onclick="getById('${org.id}')"
								src="image/operate_update.gif" style="cursor: pointer">
							&nbsp;&nbsp;&nbsp;&nbsp;
							<img alt="删除" onclick="deleteOrg('${org.id}')"
								src="image/operate_delete.gif" style="cursor: pointer">
						</td>
				</tr>
			</c:forEach>
		</table>
</td>
<td style="background: url('image/wsoa_window_006.gif');"  width="1">&nbsp;</td></tr>
  <tr>
    <td height="1" width="1"><img src="image/wsoa_window_009.gif" height="16" width="14"></td>
    <td style="background: url('image/wsoa_window_008.gif');" height="1"></td>
    <td height="1" width="1"><img src="image/wsoa_window_007.gif" height="16" width="12"></td>
  </tr>
</tbody>
</table>
		<div class="pageDiv">
		<%@include file="../page/page.jsp"%>
		</div>
	</body>
</html>